<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>编辑财务日报</title>
		  <#assign base=request.contextPath  />
		 <link rel="stylesheet" href="${base}/js/layui/css/layui.css?t=1534970980648" media="all">
		 <script type="text/javascript" src="${base}/js/zhang.js"></script>
		 <script src="${base}/js/layui/layui.js" charset="utf-8"></script>
         <script type="text/javascript" src="${base}/js/ztree/jquery-1.4.4.min.js"></script>
         <script src="${base}/js/jquery.min.js"></script>

		<style type="text/css">
		form{
		  padding:20px;
		}
		.layui-btn-radius{
                			border-radius: 5px;
                		}
		</style>
	</head>
	<body>

	<form class="layui-form" action="">
        <div class="layui-form-item">



            <div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;日期</label>
                <div class="layui-input-inline">
                    <input name="number" id="date" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;费用名称</label>
                <div class="layui-input-inline">
                    <input name="number" id="people" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;收入支出</label>
                <div class="layui-input-inline">
                    <input name="number" id="delivery" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;收入银行存款</label>
                <div class="layui-input-inline">
                    <input name="number" id="day" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;支出现金</label>
                <div class="layui-input-inline">
                    <input name="number" id="ofnursing" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;支出银行存款</label>
                <div class="layui-input-inline">
                    <input name="number" id="foodd" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;余额</label>
                <div class="layui-input-inline">
                    <input name="number" id="Sleepcondition" lay-verify="required" autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>




            <div class="layui-inline">
                <label class="layui-form-label" ><a style="color:red">*</a>&nbsp;备注</label>
                <div class="layui-input-inline">
                    <input name="number" id="heightr" placeholder="CM" lay-verify="required"  autocomplete="off" class="layui-input isNull" type="text">
                </div>
            </div>



            <div class="layui-form-item"style="margin-left:320px">
                <div class="layui-input-block">
                    <button class="layui-btn layui-btn-radius" lay-submit lay-filter="formDemo" type="button" onclick="onSbmint()" style="background-color: #0092EF;">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary layui-btn-radius">重置</button>
                </div>
            </div>
        </div>
    </form>
<script>
layui.use(['form', 'layedit', 'laydate','layer'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
   //日期
  laydate.render({
    elem: '#date'
  });


  //监听提交
 // form.on('submit(formDemo)', function(data){
 //   layer.msg(JSON.stringify(data.field));
 //   return false;
 // });
});

function onSbmint(){
var jsonDate={};
//日期
    jsonDate.name= $("#name").val();
    //费用名称
    jsonDate.name= $("#name").val();
    //收入现金
    jsonDate.name= $("#name").val();
    //收入银行存款
    jsonDate.name= $("#name").val();
    jsonDate.name= $("#name").val();
    jsonDate.name= $("#name").val();
    jsonDate.name= $("#name").val();
    jsonDate.name= $("#name").val();


      if(!isNull()){
      return;
      }
    $.ajax({
        type:"POST",
        url:"${base}/babyNursing/addbaByNursing",
        data:{"param":JSON.stringify(jsonDate)},
        success : function(data){
            layer.msg(data);
    setTimeout(function(){
        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
             parent.layer.close(index); //再执行关闭
    },200)
            jsonDate.sex =$('input:radio[name="sex"]:checked').val("");
            jsonDate.name= $("#name").val("");
            jsonDate.roomId= $("#home_id").val("");
            jsonDate.jaundice =$("#jaundice").val("");
            jsonDate.eczema =$("#eczema").val("");
            jsonDate.Hotrash =$("#Hotrash").val("");
            jsonDate.Redbuttocks =$("#Redbuttocks").val("");
            jsonDate.Eatmink =$("#Eatmink").val("");
            jsonDate.Sleepcondition =$("#Sleepcondition").val("");
            jsonDate.umbilicalcord =$("#umbilicalcord").val("");
            jsonDate.people =$("#people").val("");
            jsonDate.babynursery =$("#babynursery").val("");
            jsonDate.day =$("#day").val("");
            jsonDate.heightr =$("#heightr").val("");
            jsonDate.head =$("#head").val("");
            jsonDate.temper =$("#temper").val("");
            jsonDate.foodd =$("#foodd").val("");
            /*jsonDate.shit =$("#shit").val("");*/
            jsonDate.shower =$("#shower").val("");
            jsonDate.touch =$("#touch").val("");
            jsonDate.remarks2 =$("#remarks2").val("");
            jsonDate.weigth =$("#weigth").val("");
            //脐带消毒时间
            jsonDate.umbilicalTime =$("#date").val("");
            //脐带脱落情况
            jsonDate.umbilicalCord =$("#umbilicalCord").val("");
            //喂养时间
            jsonDate.feedTime =$("#date1").val("");
            //喂养奶量
            jsonDate.feedVolume =$("#feedVolume").val("");
            //奶瓶消毒
            jsonDate.bottle =$("#bottle").val("");
            //大便观察时间
            jsonDate.shitTime =$("#date2").val("");
            //大便观察色状
            jsonDate.shitChromatic =$("#shitChromatic").val("");
            //挤奶时间
            jsonDate.milkTime =$("#date3").val("");
            //挤奶奶量
            jsonDate.milkVolume =$("#milkVolume").val("");
            //游泳
            jsonDate.swimming =$("#swimming").val("");
            //小便时间
            jsonDate.urineTime =$("#date4").val("");
            //小便色状
            jsonDate.urineChromatic =$("#urineChromatic").val("");
            //护理类型
            jsonDate.ofnursing =$("#ofnursing").val("");
            //分娩方式
            jsonDate.delivery =$("#delivery").val("");
            var table = parent.layui.table;
            //表刷新方法
            table.reload('testReload', {
                url: '${base}/babyNursing/selectBabyNursing'
                ,where: {} //设定异步数据接口的额外参数
            });
          }
    });
 }
//获取添加时候的房间id
var bas = "${base}"
//home:变量  = zhang.js里边封装的名称(路径,"字典表里边的code")
var home_data = getDataByDicCode(bas,"home")
for(var i=0;i<home_data.length;i++){
$("#home_id").append(
    ' <option value="'+home_data[i].id+'">'+home_data[i].name+'</option>'
)

}

</script>
	</body>
</html>
